home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr49 / 342_01.zip / DIOFNC09.C < prev    next >
Text File  |  1993-04-03  |  1KB  |  47 lines

  1. /*-
  2.  *  ----------------------------------------------------------------------
  3.  *  File        :   DIOFNC09.C
  4.  *  Creator     :   Blake Miller
  5.  *  Version     :   01.01.00            February 1991
  6.  *  Language    :   Microsoft Quick C   Version 2.0
  7.  *  Purpose     :   Intel 8255 Compatible Digital IO Functions
  8.  *                  80X86 OUT Instruction Function
  9.  *  ----------------------------------------------------------------------
  10.  *  WARNING: Inline Assembly Language Here!
  11.  *  ----------------------------------------------------------------------
  12.  *  Revision History:
  13.  *  022891 BVM  :   Change int to short.
  14.  *  070490 BVM  :   Creation
  15.  *  ----------------------------------------------------------------------
  16.  */
  17.  
  18. #define     DIOFNC09_C_DEFINED
  19. #undef      DIOFNC09_C_DEFINED
  20.  
  21. void dio_bput ( short, unsigned char);
  22.  
  23. /*- DIO : Byte Put ---------------------------**
  24.  *  Write a byte to one of the 80X86 ports.
  25.  *  Duplicates the library function outp()
  26.  */
  27. void dio_bput (short d_port, unsigned char d_byte)
  28.     {
  29.     _asm    {
  30.         PUSH    AX
  31.         PUSH    DX
  32.  
  33.         MOV     DX, d_port
  34.         MOV     AL, d_byte
  35.         OUT     DX, AL
  36.  
  37.         POP     DX
  38.         POP     AX
  39.         }
  40.     }
  41.  
  42. /*-
  43.  *  ----------------------------------------------------------------------
  44.  *  END DIOFNC09.C Source File
  45.  *  ----------------------------------------------------------------------
  46.  */
  47.